<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>提现到银行卡</title>
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/swiper.min.css">
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/mui.css?v=1">
		<link rel="stylesheet" type="text/css" href="__API__/lib/css/mobileSelect.css" />
		<link rel="stylesheet" href="__API__/lib/css/style.css">
		<script type="text/javascript" src="__API__/lib/js/jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/mui.js"></script>
		<script src="__API__/lib/js/mobileSelect.js" type="text/javascript" charset="utf-8"></script>
		<script src="__API__/lib/js/city.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="__API__/lib/js/swiper.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/vue.min.js"></script>
		<script type="text/javascript" src="__API__/lib/js/common.js"></script>
		<script type="text/javascript" src="__API__/lib/js/index.js"></script>
	<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script></head>

	<body>
		<div class="page_box bg_color" id="app" style="min-height: 100vh;">
			<div class="com_head user_head">
				<p>佣金金额 (元)</p>
				<span>{{total_brokerage}}</span>
			</div>
			<div class="bank_cont">
				<div class="bank_box">
					<ul class="bank_list">
						<li>
							<span>开户行名称</span>
							<p class="p1" v-if="isBind">{{bank_title}}</p>
							<p class="p2" v-else>请先去个人中心我的银行绑定</p>
						</li>
						<li>
							<span>开户人姓名</span>
							<p class="p1" v-if="isBind">{{bank_name}}</p>
							<p class="p2" v-else>请先去个人中心我的银行绑定</p>
						</li>
						<li>
							<span>银行账号</span>
							<p class="p1" v-if="isBind">{{bank_card}}</p>
							<p class="p2" v-else>请先去个人中心我的银行绑定</p>
						</li>
						<li>
							<span>开户行地址</span>
							<p class="p1" v-if="isBind">{{bank_address}}</p>
							<p class="p2" v-else>请先去个人中心我的银行绑定</p>
						</li>
					</ul>
				</div>
				<div class="bank_box">
					<ul class="bank_list bank_list2">
						<li>
							<span>提现金额</span>
							<input type="number" placeholder="请输入提现金额" v-model="brokerage" />
						</li>
						<li>
							<span>支付密码</span>
							<input type="password" placeholder="请输入支付密码" v-model="password" />
						</li>
					</ul>
				</div>
				<div class="blue_btn bank_btn" v-if="isBind" @click="onSubmit()">提交</div>
				<div class="blue_btn bank_btn" v-else @click="goDetail('my_bank.html')">去绑定</div>
			</div>
		</div>
		<script>
			var app = null;
			app = new Vue({
				el: '#app',
				data: {
					brokerage:'',
					total_brokerage: '0',
					isBind: false,//是否绑定银行卡
					bank_title: '',
					bank_name: '',
					bank_card: '',
					bank_address: '',
					password:''

				},
				created: function() {
					var that = this;
					common.ajax("{:url('Member/my')}",{token:localStorage.getItem('token')} , function(res) {
						that.total_brokerage = res.data.brokerage
						that.bank_title = res.data.bank_title
						that.bank_name = res.data.bank_name
						that.bank_card = res.data.bank_card
						that.bank_address = res.data.bank_address
						that.isBind = res.data.bank_card
						// that.getData(searchValue);
					})
				},
				methods: {
					goDetail(url) {
						common.openUrl(url)
					},
					onSubmit(){
						let that = this;
						let data = {
							brokerage: that.brokerage,
							pay_password: that.password,

							token:localStorage.getItem('token'),


						}
						common.ajax('{:url(\'Member/withdraw_apply_bank\')}',data,function(res){
							common.showToast(res.msg);
							if(res.code == 401){

										setTimeout(function() {
											common.openUrl("{:url('api/Index/update_paypsd')}");
										}, 1000)
							}
							if(res.code == 200){

								setTimeout(function() {
									common.PageBack();
								}, 1000)
							}
						})
					}
				}
			});
		</script>
	</body>

</html>
